/**
 * User: alesj
 * Date: 2005.6.8
 * Time: 11:20:35
 * 
 * (C) Genera Lynx d.o.o.
 */

package com.generalynx.ecos.page;

import java.io.Serializable;

public abstract class IndexPageScroll extends EmptyPageScroll {

    protected int currentIdentifier;
    private String taskbar;

    protected IndexPageScroll() {
    }
    
    public Serializable getCurrentIdentifier() {
        return new Integer(currentIdentifier);
    }

    public void setCurrentIdentifier(String stringIdentifier) {
        currentIdentifier = new Integer(stringIdentifier).intValue();
    }

    public Serializable getPreviousIdentifier() {
        return new Integer(currentIdentifier - 1);
    }

    public Serializable getNextIdentifier() {
        return new Integer(currentIdentifier + 1);
    }

    public boolean isFirst() {
        return (currentIdentifier == 0);
    }

    protected abstract String doTaskbar();

    public String getTaskbar() {
        if (taskbar == null) {
            taskbar = doTaskbar();
        }
        return taskbar;
    }

}
